<!DOCTYPE html>
<html lang="en" xmlns:style="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>登陆界面</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
    <script type="text/javascript" src="./layui/layui.all.js"></script>
    <script type="text/javascript" src="./layui/layui.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">日记系统登陆管理区</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left ">
            <li class="layui-nav-item"><a href="">控制台</a></li>
        </ul>

    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">所有功能</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/login.html">注册界面</a></dd>
                        <dd><a href="/loginSuccess.html">登陆界面</a></dd>


                    </dl>
                </li>

            </ul>
        </div>
    </div>


    <div class="layui-body"><br><br>
        <h1 style="margin-left: 42px;color: #1E9FFF"><strong>登陆界面</strong></h1>
        <!--<a href="/login/message">登陆信息查询</a>-->
        <br><br>
        <form class="layui-form" action="/login/over" method="post" onsubmit="return submit2()">
            <div class="layui-form-item">
                <label class="layui-form-label">用户名:</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" lay-verify="required" class="layui-input" lay-reqtext="用户名是必填项，岂能为空？"
                           placeholder="请输入用户名" id="username" onblur="Name()">
                </div>

                <label id="label"></label>
            </div>
            <input type="hidden" name="id" value="123">
            <div class="layui-form-item">
                <label class="layui-form-label">密码:</label>
                <div class="layui-input-inline">
                    <input type="text" name="pwd" class="layui-input" placeholder="请输入密码" id="pwd" onblur="Pwd()">
                </div>

                <label id="label2"></label>
            </div>
            <br>

            <button style="margin-left: 111px;" class="layui-btn">登陆</button>
        </form>


        <!-- 内容主体区域 -->
    </div>


    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © gaoyuan.com - 底部固定区域
    </div>
</div>
</div>
<script src="../src/layui.js"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;

    });

    var username = document.getElementById("username");
    var label = document.getElementById("label");

    function Name() {
        if (username.value != null && username.value != "") {
            label.innerHTML = "";
        } else {
            label.innerHTML = "请输入用户名";

            username.focus();
            console.log(username.value);
            label.style.color = "red";
        }

    };


    var pwd = document.getElementById("pwd");
    var label2 = document.getElementById("label2");

    function Pwd() {
        if (pwd.value != null && pwd.value != "") {
            label2.innerHTML = "";
        } else {
            label2.innerHTML = "请输入密码";
            label2.style.color = "red";
        }

    };


    function submit2() {
        if (username.value == "" || pwd.value == "") {
            return false;
        }
        return true;
    };


</script>

</body>


</html>